package com.llws.petgoodsshop.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("test")
public class TestController {

    @RequestMapping("tojson")
    public List<Map<String,String>> jsonList(){
        List<Map<String,String>> jsonList = new LinkedList<>();
        Map<String, String> map = new HashMap<>();
        map.put("name","香港");
        map.put("value","20");
        Map<String, String> map2 = new HashMap<>();
        map2.put("name","北京");
        map2.put("value","30");
        jsonList.add(map);
        jsonList.add(map2);
        return jsonList;
    }
}
